package com.zb.entity.dto;

import com.zb.annotation.IntegerPattern;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @Author WEN
 * @Date 2024/3/21 0021
 **/
@Data
@ApiModel("短信模板")
public class SmsTemplateDto {
    @ApiModelProperty(value = "短信模板ID，新增不必传，修改必传")
    private Long id;

    @NotNull(message = "短信类型不能为空")
    @IntegerPattern(regexp = "^(1|2|3)$", message = "短信类型参数不合法")
    @ApiModelProperty(value = "短信类型：1-验证类短信，2-通知类，3-推广类短信", required = true, example = "1")
    private Integer type;

    @NotBlank(message = "模板编号不能为空")
    @Length(min = 2, max = 60, message = "模板编号长度限制60个字符，且至少输入2个字符")
    @ApiModelProperty(value = "模板编号", required = true)
    private String code;

    @NotBlank(message = "模板名称不能为空")
    @Length(max = 30, message = "模板名称长度")
    @ApiModelProperty(value = "模板名称", required = true)
    private String name;

    @NotBlank(message = "模板内容不能为空")
    @Length(max = 500, message = "模板内容长度限制500个字符以内")
    @ApiModelProperty(value = "模板内容", required = true)
    private String content;

    @NotBlank(message = "场景说明不能为空")
    @Length(max = 500, message = "场景说明长度限制500个字符以内")
    @ApiModelProperty(value = "场景说明", required = true)
    private String remark;

    @NotNull(message = "允许编辑接收短信的角色项不能为空")
    @ApiModelProperty(value = "是否允许编辑接收短信的角色：false-不允许，true-允许", required = true, example = "false")
    private Boolean updateReceiveRole;

    @NotNull(message = "短信状态不能为空")
    @ApiModelProperty(value = "短信状态：false-启用，true-禁用", required = true, example = "false")
    private Boolean status;

    @ApiModelProperty(value = "接收短信的角色类型：1-客服、2-指定人员，3-服务商负责人，4-工程师，5-客户；当updateReceiveRole=true时，该字段必填，至少选择一项")
    private List<Integer> roleType;
}
